package com.example.android.snake;

/**
 * Simple class containing two integer values and a comparison function.
 * There's probably something I should use instead, but this was quick and
 * easy to build.
 * 
 */
public class PairDouble {
    public float x;
    public float y;

    public PairDouble(double newX, double newY) {
        x = (float)newX;
        y = (float)newY;
    }

    public boolean equals(PairDouble other) {
        if (Math.abs(x - other.x)<0.05 && Math.abs(y- other.y)<0.05) {
            return true;
        }
        return false;
    }

    @Override
    public String toString() {
        return "Coordinate: [" + x + "," + y + "]";
    }
}